package 笔试.皇甫;

import javafx.concurrent.ScheduledService;

import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/9/26-16:00
 * @version:1.0
 * @function:
 */
public class Main02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        Queue<Integer> queue = new ArrayDeque<>();
        int i =0,j=1;
        boolean flag = true;  // true a 出队 ， false b 出队
        while (j<=n){
            i++;
            if(flag&&i==a){
                flag = !flag;
                i = 0;
            }else if (!flag&&i==b){
                flag = !flag;
                i = 0;
            }else {
                queue.add(j);
            }
            j++;
        }
        System.out.println();
    }
}
